Building Heaps Fast
نویسندگان
چکیده
We present an algorithm to construct a heap which uses on average (a + o(l))n comparisons to build a heap on n elements, where (x = 1.52. Indeed on the overwhelming proportion of inputs our algorithm uses this many comparisons. This average complexity is better than that known for any other algorithm. We conjecture that it is optimal. Our method is a natural variant of the standard heap construction method due to Floyd.
منابع مشابه
An Efficient Construction Algorithm for a Class of Implicit Double-Ended Priority Queues
Priority queues and double-ended priority queues are fundamental data types in Computer Science, and various data structures have been proposed to implement them. In particular, diamond deques, interval heaps, min-max-pair heaps, and twin-heaps provide implicit structures for double-ended priority queues. Although these heap-like structures are essentially the same when they are presented in an...
متن کاملRelaxed Fibonacci heaps : An alternative to Fibonacci heaps with worst case rather than amortized time bounds ∗ Chandrasekhar
We present a new data structure called relaxed Fibonacci heaps for implementing priority queues on a RAM. Relaxed Fibonacci heaps support the operations find minimum, insert, decrease key and meld, each in O(1) worst case time and delete and delete min in O(log n) worst case time. Introduction The implementation of priority queues is a classical problem in data structures. Priority queues find ...
متن کاملHeap building bounds
We have considered the uppper and lower bounds for building heaps in the worst and average cases. Heaps are binary tree for which all its levels are full except the last one. The nodes on the last level are all as much to the left as possible. A max-heap has the property that every node has value greater or equal to that of its children. We have studied the contruction of heaps in the compariso...
متن کاملNovel Transformation Techniques Using Q-Heaps with Applications to Computational Geometry
Using the notions of Q-heaps and fusion trees developed by Fredman and Willard, we develop general transformation techniques to reduce a number of computational geometry problems to their special versions in partially ranked spaces. In particular, we develop a fast fractional cascading technique, which uses linear space and enables sublogarithmic iterative search on catalog trees in the case wh...
متن کاملOn the number of heaps and the cost of heap construction∗
Heaps constitute a well-known data structure allowing the implementation of an efficient O(n log n) sorting algorithm as well as the design of fast priority queues. Although heaps have been known for long, their combinatorial properties are still partially worked out: exact summation formulae have been stated, but most of the asymptotic behaviors are still unknown. In this paper, we present a n...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- J. Algorithms
دوره 10 شماره
صفحات -
تاریخ انتشار 1989